#include<stdio.h>
int i;
double jiajian(char a[]);
double chen(char a[]);
double f(char a[]);
int main()
{
	char a[100] = { 0 };
	double x;
	while (gets(a) != NULL)
	{
		i = 0;
		x=jiajian(a);
		printf("%.3lf\n", x);
	}
	return 0;
}
double jiajian(char a[])
{
	double s = chen(a);
	int flag = 1;
	while (flag)
	{
		if (a[i] == '+' || a[i] == '-')
		{
			char c = a[i];
			i++;
			double value = chen(a);
			if (c == '+')
				s=s+value;
			else
				s=s-value;
		}
		else
			flag = 0;
	}
	return s;
}
double chen(char a[])
{
	double s = f(a);
	while (1)
	{
		char c = a[i];
		if (c == '*' || c == '/')
		{
			i++;
			double value = f(a);
			if (c == '*')
				s=s*value;
			else
				s=s/value;
		}
		else
			break;
	}
	return s;
}
double f(char a[])
{
	double s = 0,value=0;
	char c = a[i];
	int flag = 1, point = 1, j = 1;
	if (c == '(')
	{
		i++;
		s=jiajian(a);
		i++;
	}
	else
	{
		if (i>0&&a[i-1]=='-')
			flag = -1;
		while (((a[i]>='0')&&(a[i]<='9'))||a[i]=='.')
		{
			if (a[i]=='.')
			{
				point=0;
				i++;
			}
			if (point)
				s=s*10+a[i++]-'0';
			else
			{
				value = value * 10 + a[i++] - '0';
				j *= 10;
			}
		}
	}
	return s+value/j;
}

